import { utils } from 'hi-ui';
import { currentUserID } from "@/utils/common.js";
export default {
  id: "CashierpayDetailEntity",
  modelFile: "finance/cashierpay/dataset/CashierpayDetailEntity.xml",
  //主从配置
  relation: {
    selfField: ["FNUMBER"],
    parentField: ["FNUMBER"]
  },
  sortFields: [
    "FID",
    "FNUMBER",
    "FWORKNUMBER",
    "FPAYWAY",
    "FMONEY",
    "FPAYMENT",
    "FDIFFERMONEY",
    "FBEGINTIME",
    "FENDTIME",
    "FNOTE",
    "FAUDIT",
    "FUSERID",
    "FCREATEDATE",
    "FENTERPRISEDESC",
    "FENTERPRISEID",
    "FSORT"
  ],
  //字段元素
  element: {
    eleSort: {
      field: "FSORT",
    }
  },
  fields: {
    FID: {
      name: "FID", //字段ID
      label: "ID", //字段描述
      dbtype: "dbString", //数据类型
      default: {
        //默认值
        //rule: 'first', //prior   填充规则
        exps: (data) => {
          //填充表达式
          return utils.string.guid();
        },
      },
    },
    FNUMBER: {
      name: "FNUMBER", //字段ID
      label: "单号", //字段描述
      dbtype: "dbString", //数据类型
      required: true,
      readonly: true,
      length: 25,

    },
    FSORT: {
      name: "FSORT", //字段ID
      label: "排序", //字段描述
      dbtype: "dbInt", //数据类型

    },
    FUSERID: {
      name: "FUSERID", //字段ID
      label: "创建人", //字段描述
      dbtype: "dbString", //数据类型
      length: 25,

      default: {
        //默认值
        exps: (data) => {
          //填充表达式
          return currentUserID();
        },
      },
    },
    FENTERPRISEDESC: {
      name: "FENTERPRISEDESC", //字段ID
      label: "企业名称", //字段描述
      dbtype: "dbString", //数据类型
      length: 25,
    },
    FENTERPRISEID: {
      name: "FENTERPRISEID", //字段ID
      label: "企业ID", //字段描述
      dbtype: "dbString", //数据类型
      length: 25,
    },
    FCREATEDATE: {
      name: "FCREATEDATE", //字段ID
      label: "创建时间", //字段描述
      dbtype: "dbDate", //数据类型
      default: {
        //默认值
        exps: (data) => {
          //填充表达式
          return utils.date.format(new Date(), "yyyy-MM-dd HH:mm:ss");
        },
      },

    }, FWORKNUMBER: {
      name: "FWORKNUMBER", //字段ID
      label: "交班单", //字段描述
      dbtype: "dbString", //数据类型
      required: true,

      length: 25,
    }, FPAYWAY: {
      name: "FPAYWAY", //字段ID
      label: "付款方式", //字段描述
      dbtype: "dbString", //数据类型
      required: true,

      length: 25,
    },
    FMONEY: {
      name: "FMONEY", //字段ID
      label: "金额", //字段描述
      dbtype: "dbFloat", //数据类型
      required: true,


    }, FPAYMENT: {
      name: "FPAYMENT", //字段ID
      label: "实交金额", //字段描述
      dbtype: "dbFloat", //数据类型
      required: true,
    }, FDIFFERMONEY: {
      name: "FDIFFERMONEY", //字段ID
      label: "差额", //字段描述
      dbtype: "dbFloat", //数据类型
      required: true,


    }, FBEGINTIME: {
      name: "FBEGINTIME", //字段ID
      label: "开始时间", //字段描述
      dbtype: "dbDate", //数据类型
      required: true,

    }, FENDTIME: {
      name: "FENDTIME", //字段ID
      label: "结束时间", //字段描述
      dbtype: "dbDate", //数据类型
      required: true,


    }, FNOTE: {
      name: "FNOTE", //字段ID
      label: "备注", //字段描述
      dbtype: "dbString", //数据类型
      length: 250,
    },

    FAUDIT: {
      name: "FAUDIT", //字段ID
      label: "审核", //字段描述
      dbtype: "dbInt", //数据类型

    },
  }
}